async function request(url, data = null) {
  url = url.includes('http') ? url : 'http://localhost:9090' + url
  if (data == null) {
    var ret = await (await fetch(url)).json()
  } else {
    var ret = await (await fetch(url, {
      method:'POST',
      body: JSON.stringify(data),
      headers: {
        'content-type': 'application/json'
      }
    })).json()
  }
  return ret
}

